/*
 * Copyright (c) 2011 Jean-Marc Perronne
 * Ensisa, 12 rue des Freres Lumieres, F-68093 Mulhouse cedex
 * All rights reserved.
 *
 * The copyright of this software is owned by Werner Randelshofer. 
 * You may not use, copy or modify this software, except in  
 * accordance with the license agreement you entered into with  
 * Jean-Marc Perronne. For details see accompanying license terms. 
 */

package fr.uha.ensisa.jmp.drone.at_commands;

public class AtMTrimCommand extends AbstractAtCommand
{
	private float trimTheta;
	private float trimPhi;
	private float trimYaw;

	public AtMTrimCommand()
	{
		super("MTRIM");
		this.trimTheta = 0f;
		this.trimPhi = 0f;
		this.trimYaw = 0f;
	}

	public void param(float trimTheta, float trimPhi, float trimYaw)
	{
		this.unReady();
		this.trimTheta = trimTheta;
		this.trimPhi = trimPhi;
		this.trimYaw = trimYaw;
	}

	public float trimTheta()
	{
		return this.trimTheta;
	}

	public float trimPhi()
	{
		return this.trimPhi;
	}

	public float trimYaw()
	{
		return this.trimYaw;
	}

	@Override
	protected void appendParamaters(StringBuilder builder)
	{
		builder.append(',').append(Float.floatToIntBits(this.trimTheta));
		builder.append(',').append(Float.floatToIntBits(this.trimPhi));
		builder.append(',').append(Float.floatToIntBits(this.trimYaw));		
	}
}
